home *** CD-ROM | disk | FTP | other *** search
/ Ian & Stuart's Australian Mac: Not for Sale / Another.not.for.sale (Australia).iso / fade into you / getting there / TCP⁄PPP⁄SLIP / Scripts / Annex-UCBerkeley < prev    next >
Text File  |  1993-10-18  |  3KB  |  130 lines

  1. ! From: werner@soe.berkeley.edu (John Werner)
  2. ! Newsgroups: comp.sys.mac.comm
  3. ! Subject: Re: SLIP on a Xylogics Annex
  4. ! Date: Sun, 17 Oct 1993 11:28:02 -0800
  5. !
  6. ! [...stuff deleted...]
  7. !
  8. ! Here's the script we're using at UC Berkeley.  I think
  9. ! it's derived from a Cisco script, and most of it isn't used.
  10. ! We have static IP addresses, so this script doesn't bother
  11. ! parsing the addreses the Annex prints.
  12. !
  13. ! InterSLIP gateway script for Annex terminal server
  14. !
  15. ! Label 99 is the general purpose error handler, which beeps
  16. ! and pauses long enough for the user to read the message.
  17. !
  18. ! First, we wait for the user name prompt
  19. !
  20. @originate
  21. note "Waiting for prompt"
  22. pause 30
  23. write "\13"
  24. matchclr
  25. matchstr 1 100 "==>"
  26. matchread 250
  27. note "No prompt"
  28. jump 99
  29. !
  30. !go into slip mode!!
  31. !
  32. @label 100
  33. note "Entering slip mode"
  34. write "slip\13"
  35. matchclr
  36. matchstr 1 1 "Username:"
  37. matchread 50
  38. note "No username prompt"
  39. jump 99
  40. !
  41. ! Now, send the user name and wait for the password prompt
  42. !
  43. @label 1
  44. note "Sending user name"
  45. write "^5\13"
  46. matchclr
  47. matchstr 1 2 "Password:"
  48. matchread 50
  49. note "No password prompt"
  50. jump 99
  51. !
  52. ! Send the password and wait for either the terminal server
  53. ! prompt or an error message
  54. !
  55. @label 2
  56. note "Sending password"
  57. write "^6\13"
  58. matchclr
  59. matchstr 1 7 "Switching to SLIP"
  60. matchstr 2 3 "Access denied"
  61. matchread 120
  62. jump 99
  63. !
  64. ! If we got an error message, notify the user and fail
  65. !
  66. @label 3
  67. note "Access Denied"
  68. !
  69. ! General purpose error handler.  Let the message appear,
  70. ! beep, and then pause for a second.
  71. !
  72. @label 99
  73. pause 1
  74. sound
  75. pause 60
  76. exit -1
  77. !
  78. ! If we've successfully logged in, ask for SLIP mode and
  79. ! wait for the response.  If we get anything except
  80. ! "Entering SLIP mode.", assume something went wrong, and fail.
  81. !
  82. !Skip this!
  83. !
  84. @label 4
  85. note "Switching to SLIP"
  86. !write "slip\13"
  87. matchclr
  88. matchstr 1 7 "Switching to SLIP"
  89. matchread 120
  90. note "Cannot invoke SLIP mode"
  91. jump 99
  92. !
  93. ! We've entered SLIP mode, so match on the first thing that
  94. ! looks like an IP address.  If we don't find one, fail.
  95. !
  96. !Skip this!
  97. !
  98. @label 5
  99. matchclr
  100. matchexp 1 6 "[0-9][0-9]*\\.[0-9][0-9]*\\.[0-9][0-9]*\\.[0-9][0-9]*\\."
  101. matchread 120
  102. note "No IP address given"
  103. jump 99
  104. !
  105. ! We've found an IP address, so inform MacTCP of it, and
  106. ! watch for a number (the MTU size).
  107. !
  108. !Skip this!
  109. !
  110. @label 6
  111. setip "^0"
  112. matchclr
  113. matchexp 1 7 "[0-9][0-9]*"
  114. matchread 120
  115. note "No MTU value"
  116. jump 99
  117. !
  118. ! We found the MTU size, so inform MacTCP and exit
  119. ! the script successfully.
  120. !
  121. @label 7
  122. !setmtu "^0"
  123. exit 0
  124. !
  125. ! Answer and Hangup modes are currently unused in gateway
  126. ! scripts, but just for future compatibility, exit successfully.
  127. !
  128. @answer
  129. @hangup
  130. exit 0